Call ReleaseDC() on DCs acquired with GetDC() (for windows), and
authorTor Lillqvist <tml@novell.com>
Fri, 9 Jun 2006 09:17:47 +0000 (09:17 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Fri, 9 Jun 2006 09:17:47 +0000 (09:17 +0000)
2006-06-09  Tor Lillqvist  <tml@novell.com>

* gdk/win32/gdkdrawable-win32.c (_gdk_win32_drawable_release_dc):
Call ReleaseDC() on DCs acquired with GetDC() (for windows), and
DeleteDC() on DCs acquired with CreateCompatibleDC() (for
bitmaps). According to MSDN, this is the correct thing to do, even
if always using DeleteDC() seems to have worked fine in
practice. (#337491)

ChangeLog
ChangeLog.pre-2-10
gdk/win32/gdkdrawable-win32.c

index 1c6aadbf5f2d36724762103d36502889c3a0df52..c67673d54b7e91710ae059f41768c979bec9df6f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-06-09  Tor Lillqvist  <tml@novell.com>
+
+       * gdk/win32/gdkdrawable-win32.c (_gdk_win32_drawable_release_dc):
+       Call ReleaseDC() on DCs acquired with GetDC() (for windows), and
+       DeleteDC() on DCs acquired with CreateCompatibleDC() (for
+       bitmaps). According to MSDN, this is the correct thing to do, even
+       if always using DeleteDC() seems to have worked fine in
+       practice. (#337491)
+
 2006-06-08  Matthias Clasen  <mclasen@redhat.com>
 
        * tests/testprint.c: Update for api changes.
index 1c6aadbf5f2d36724762103d36502889c3a0df52..c67673d54b7e91710ae059f41768c979bec9df6f 100644 (file)
@@ -1,3 +1,12 @@
+2006-06-09  Tor Lillqvist  <tml@novell.com>
+
+       * gdk/win32/gdkdrawable-win32.c (_gdk_win32_drawable_release_dc):
+       Call ReleaseDC() on DCs acquired with GetDC() (for windows), and
+       DeleteDC() on DCs acquired with CreateCompatibleDC() (for
+       bitmaps). According to MSDN, this is the correct thing to do, even
+       if always using DeleteDC() seems to have worked fine in
+       practice. (#337491)
+
 2006-06-08  Matthias Clasen  <mclasen@redhat.com>
 
        * tests/testprint.c: Update for api changes.
index d14dfc1d88473614b608c2595a68d66acb6be7c0..9171ca35c2c5451a64b5366fc5e18ec7a5a429ba 100644 (file)
@@ -1889,7 +1889,10 @@ _gdk_win32_drawable_release_dc (GdkDrawable *drawable)
       
       if (impl->hdc)
        {
-         GDI_CALL (DeleteDC, (impl->hdc));
+         if (GDK_IS_PIXMAP_IMPL_WIN32 (impl))
+           GDI_CALL (DeleteDC, (impl->hdc));
+         else
+           GDI_CALL (ReleaseDC, (impl->handle, impl->hdc));
          impl->hdc = NULL;
        }
     }